<?php
class mysql{
	function Connect(){
  		$host = "localhost";
  		$name = "root";
  		$pass = "";
  		$db = "kk"; 
  		$connection=mysql_connect($host,$name,$pass);
  		mysql_select_db($db,$connection);
  	}
  
  	function Close(){
  		mysql_close($this->connection);
  	}
  
  	function FetchRow($query){
    	$rows = mysql_fetch_row($query);
  		return $rows;
  	}
  
  	function FetchArray($query){
  		$array = mysql_fetch_array($query);
  		return $array;
  	}
  
  	function FetchNum($query){
  		$num = mysql_num_rows($query);
  		return $num;
  	}
  
  	function Query($sql){
  		$query = mysql_query($sql) or die(mysql_error());
  		return $query;
  	}
}
?>
